home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d7 / lanuts.arc / KC.C < prev    next >
Text File  |  1991-10-30  |  369b  |  22 lines

  1. /* get keycode */
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <dos.h>
  5.  
  6. main () {
  7.   int done;
  8.   union REGS regs;
  9.   
  10.   done = FALSE;
  11.   while (!done) {
  12.     puts("Press a key");
  13.     regs.x.ax = 0;
  14.     int86(0x16,®s,®s);
  15.     
  16.     printf("Key code is Scan %x, Ascii %x.\n",regs.h.ah,regs.h.al);
  17.  
  18.     if (regs.h.al == 27) done = TRUE;
  19.  
  20.   }
  21. }
  22.